// import React from 'react'
import { Layout, Menu } from 'antd';
import { Route, Link, Switch } from 'react-router-dom';
import MoveList from './movielist'
import Moviedetail from './moviedetail.jsx'
const { Content, Sider } = Layout;


export default class index extends React.Component {
  render() {
    return <Layout style={{ backgroundColor: '#E0E0E0' }}>
      <Sider width={200} className="site-layout-background">
        <Menu
          mode="inline"
          defaultSelectedKeys={[window.location.hash.split('/')[2]]}
          style={{ height: '100%', borderRight: 0 }}
        >
          <Menu.Item key="in_theaters">
            <Link to='/movie/in_theaters/1'>正在热映</Link>
          </Menu.Item>
          <Menu.Item key="coming_soon">
            <Link to='/movie/coming_soon/1'>即将上映</Link>
          </Menu.Item>
          <Menu.Item key="top250">
            <Link to='/movie/top250/1'>top250</Link>
          </Menu.Item>

        </Menu>
      </Sider>
      <Layout style={{ padding: '0px 5px', backgroundColor: '#fff', margin: '0px 10px' }}>
        <Content
          className="site-layout-background"
          style={{
            padding: 10,
            margin: 0,
            minHeight: 280,
          }}
        >
          <Switch>
            <Route path="/movie/detail/:title/:id" component={Moviedetail} />
            <Route path="/movie/:type/:page" component={MoveList} />
          </Switch>
        </Content>
      </Layout>
    </Layout>
  }
}
